﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using EasySL.Entity;
using EasySL.Controls;
using EasySL.Core;

namespace EasySL.UI.Controls
{
    public partial class ProductList : UserControl
    {       
        public ProductList()
        {
            InitializeComponent();

            this.pager.PageCount = 34;
            this.pager.OnPageIndexChange += new PageIndexChange(pager_OnPageIndexChange);

            this.InitTask();

            this.taskManager.Start();
        }

        void pager_OnPageIndexChange(int pageIndex)
        {
            this.pageIndex = pageIndex;
            this.getProductListTask.Start();
        }       

        private void opPanal_MouseEnter(object sender, MouseEventArgs e)
        {
            this.opPanal.Opacity = 1;
        }

        private void opPanal_MouseLeave(object sender, MouseEventArgs e)
        {
            this.opPanal.Opacity = 0.8;
        }

        private ObservableCollection<Product> products;
        private List<Category> categorys;
        private int pageIndex = 1;

        
        
    }
}
